1 from utils import (
2     safe_input,
3     get_products,
4     get_employees,
5     get_sales
6 )

7
8 from
actions import (
9     register_sale,
10     register_product_arrival,
11     query_inventory_data,
12     employees_with_most_sales,
13     most_sold_items
14 )
15
16
17 def main():
18     print(
"SALES AND INVENTORY SYSTEM")
19     print(
"""
20 Select an action

21
22 1
. Register sale
23 2
. Register product arrival
24 3
. Query inventory data
25 4
. Employees with most sales
26 """
)
27
28     
while True:
29         
30         action = safe_input(
'int_positive', 'Action: ')
31
32         
if action > 0 and action < 9:
33             
break
34
35         print(
"Oops! Try again with an action from 1 to 8")
36
37     
38     
if action == 1:
39         register_sale()
40     elif action ==
2:
41         register_product_arrival()
42     elif action ==
3:
43         query_inventory_data()
44     elif action ==
4:
45         employees_with_most_sales()
46
47     print(
"Thanks for using the system. Have a great day\n")
48
49
50 while
True:
51     main()
52
53     again = input(
"Do you want to start again? (y/n) ").strip()[0].lower()
54
55     
if (again == 'y'):
56         
continue
57     
else:
58         print(
"Cool. See you later ;)\n")
59         
break


Gõ tìm kiếm nhanh...